n = eval(input())

#使用两个变量来记录当前最长字符串的长度和当前最长字符串
maxLength = 0
s = ''
for i in range(0,n):
    curS = input()
    if len(curS) > maxLength:
        maxLength = len(curS)
        s = curS
print("The longest is: " + s)
